% *************** upsTex style definitions ***************

% *************** Load packages ***************
%\usepackage{times}
\usepackage{ifpdf}
\usepackage{textcomp}
\usepackage[top=2.5cm, bottom=2.5cm, left=3.5cm, right=2.5cm]{geometry}

\ifpdf
	%\usepackage[T1]{fontenc}
	%\usepackage{pxfonts}
	%\usepackage{aeguill}
	\usepackage[pdftex]{graphicx}
\else
	\usepackage{graphicx}
\fi

\usepackage{epsfig}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{booktabs}
\usepackage{stmaryrd}
\usepackage{url}
\usepackage{longtable}
\usepackage[figuresright]{rotating}
\usepackage{tabularx}
\usepackage{boxedminipage}
\usepackage{verbatim}
\usepackage{listings}
\usepackage{enumerate}
%\usepackage{colortbl}

% *************** Enable index generation ***************
\usepackage{makeidx}
\makeindex

% *************** Add reference to page number at which bibliography entry is cited ***************
%\usepackage{citeref}
%\renewcommand{\bibitempages}[1]{\newblock {\scriptsize [\mbox{cited at p.\ }#1]}}

% *************** Some colour definitions ***************
\ifpdf
	\usepackage[pdftex]{color}
\else
	\usepackage{color}
\fi

\definecolor{greenyellow}   {cmyk}{0.15, 0   , 0.69, 0   }
\definecolor{yellow}        {cmyk}{0   , 0   , 1   , 0   }
\definecolor{goldenrod}     {cmyk}{0   , 0.10, 0.84, 0   }
\definecolor{dandelion}     {cmyk}{0   , 0.29, 0.84, 0   }
\definecolor{apricot}       {cmyk}{0   , 0.32, 0.52, 0   }
\definecolor{peach}         {cmyk}{0   , 0.50, 0.70, 0   }
\definecolor{melon}         {cmyk}{0   , 0.46, 0.50, 0   }
\definecolor{yelloworange}  {cmyk}{0   , 0.42, 1   , 0   }
\definecolor{orange}        {cmyk}{0   , 0.61, 0.87, 0   }
\definecolor{burntorange}   {cmyk}{0   , 0.51, 1   , 0   }
\definecolor{bittersweet}   {cmyk}{0   , 0.75, 1   , 0.24}
\definecolor{redorange}     {cmyk}{0   , 0.77, 0.87, 0   }
\definecolor{mahogany}      {cmyk}{0   , 0.85, 0.87, 0.35}
\definecolor{maroon}        {cmyk}{0   , 0.87, 0.68, 0.32}
\definecolor{brickred}      {cmyk}{0   , 0.89, 0.94, 0.28}
\definecolor{red}           {cmyk}{0   , 1   , 1   , 0   }
\definecolor{orangered}     {cmyk}{0   , 1   , 0.50, 0   }
\definecolor{rubinered}     {cmyk}{0   , 1   , 0.13, 0   }
\definecolor{wildstrawberry}{cmyk}{0   , 0.96, 0.39, 0   }
\definecolor{salmon}        {cmyk}{0   , 0.53, 0.38, 0   }
\definecolor{carnationpink} {cmyk}{0   , 0.63, 0   , 0   }
\definecolor{magenta}       {cmyk}{0   , 1   , 0   , 0   }
\definecolor{violetred}     {cmyk}{0   , 0.81, 0   , 0   }
\definecolor{rhodamine}     {cmyk}{0   , 0.82, 0   , 0   }
\definecolor{mulberry}      {cmyk}{0.34, 0.90, 0   , 0.02}
\definecolor{redviolet}     {cmyk}{0.07, 0.90, 0   , 0.34}
\definecolor{fuchsia}       {cmyk}{0.47, 0.91, 0   , 0.08}
\definecolor{lavender}      {cmyk}{0   , 0.48, 0   , 0   }
\definecolor{thistle}       {cmyk}{0.12, 0.59, 0   , 0   }
\definecolor{orchid}        {cmyk}{0.32, 0.64, 0   , 0   }
\definecolor{darkorchid}    {cmyk}{0.40, 0.80, 0.20, 0   }
\definecolor{purple}        {cmyk}{0.45, 0.86, 0   , 0   }
\definecolor{plum}          {cmyk}{0.50, 1   , 0   , 0   }
\definecolor{violet}        {cmyk}{0.79, 0.88, 0   , 0   }
\definecolor{royalpurple}   {cmyk}{0.75, 0.90, 0   , 0   }
\definecolor{blueviolet}    {cmyk}{0.86, 0.91, 0   , 0.04}
\definecolor{periwinkle}    {cmyk}{0.57, 0.55, 0   , 0   }
\definecolor{cadetblue}     {cmyk}{0.62, 0.57, 0.23, 0   }
\definecolor{cornflowerblue}{cmyk}{0.65, 0.13, 0   , 0   }
\definecolor{midnightblue}  {cmyk}{0.98, 0.13, 0   , 0.43}
\definecolor{navyblue}      {cmyk}{0.94, 0.54, 0   , 0   }
\definecolor{royalblue}     {cmyk}{1   , 0.50, 0   , 0   }
\definecolor{blue}          {cmyk}{1   , 1   , 0   , 0   }
\definecolor{cerulean}      {cmyk}{0.94, 0.11, 0   , 0   }
\definecolor{cyan}          {cmyk}{1   , 0   , 0   , 0   }
\definecolor{processblue}   {cmyk}{0.96, 0   , 0   , 0   }
\definecolor{skyblue}       {cmyk}{0.62, 0   , 0.12, 0   }
\definecolor{turquoise}     {cmyk}{0.85, 0   , 0.20, 0   }
\definecolor{tealblue}      {cmyk}{0.86, 0   , 0.34, 0.02}
\definecolor{aquamarine}    {cmyk}{0.82, 0   , 0.30, 0   }
\definecolor{bluegreen}     {cmyk}{0.85, 0   , 0.33, 0   }
\definecolor{emerald}       {cmyk}{1   , 0   , 0.50, 0   }
\definecolor{junglegreen}   {cmyk}{0.99, 0   , 0.52, 0   }
\definecolor{seagreen}      {cmyk}{0.69, 0   , 0.50, 0   }
\definecolor{green}         {cmyk}{1   , 0   , 1   , 0   }
\definecolor{forestgreen}   {cmyk}{0.91, 0   , 0.88, 0.12}
\definecolor{pinegreen}     {cmyk}{0.92, 0   , 0.59, 0.25}
\definecolor{limegreen}     {cmyk}{0.50, 0   , 1   , 0   }
\definecolor{yellowgreen}   {cmyk}{0.44, 0   , 0.74, 0   }
\definecolor{springgreen}   {cmyk}{0.26, 0   , 0.76, 0   }
\definecolor{olivegreen}    {cmyk}{0.64, 0   , 0.95, 0.40}
\definecolor{rawsienna}     {cmyk}{0   , 0.72, 1   , 0.45}
\definecolor{sepia}         {cmyk}{0   , 0.83, 1   , 0.70}
\definecolor{brown}         {cmyk}{0   , 0.81, 1   , 0.60}
\definecolor{tan}           {cmyk}{0.14, 0.42, 0.56, 0   }
\definecolor{gray}          {cmyk}{0   , 0   , 0   , 0.50}
\definecolor{black}         {cmyk}{0   , 0   , 0   , 1   }
\definecolor{white}         {cmyk}{0   , 0   , 0   , 0   }

% *************** Enable hyperlinks in PDF documents ***************

\ifpdf
    \pdfcompresslevel=9
        \usepackage[
			plainpages=false,
			pdfpagelabels,
			pdffitwindow=false,
			bookmarksnumbered=false,%
			bookmarksopenlevel=\maxdimen,
			bookmarksopen=true,
			pdfstartview=FitH,
			colorlinks,%
			hyperindex,
			breaklinks,
			%backref,
			linkcolor=blue,%
			citecolor=red,%
			filecolor=maroon,%
			pagecolor=red,%
			urlcolor=magenta,%
			pdftex,%
			unicode,
			pdfauthor={PNM Silva},
			pdftitle={Infrastructure for Intrusion Detection on Xen Virtualization},
			pdfsubject={Final Year Project Thesis},
			]{hyperref}
    \input supp-mis.tex
    \input supp-pdf.tex
    \pdfimageresolution=900
    \usepackage{thumbpdf}

\else

	\usepackage{hyperref}
\fi


\setlength{\parskip}{1.5ex plus 0.5ex minus 0.2ex}
%\setlength{\parindent}{1cm}
%\usepackage{memhfixc}

% *************** Page layout ***************
%\settypeblocksize{*}{32pc}{1.618}
%
%\setlrmargins{*}{1.47in}{*}
%\setulmargins{*}{*}{1.3}
%
%\setheadfoot{\onelineskip}{2\onelineskip}
%\setheaderspaces{*}{2\onelineskip}{*}
%
%\def\baselinestretch{1.1}
%
%\checkandfixthelayout

% *************** Chapter and section style ***************
%\makechapterstyle{mychapterstyle}{%
    %\renewcommand{\chapnamefont}{\LARGE\sffamily\bfseries}%
    %\renewcommand{\chapnumfont}{\LARGE\sffamily\bfseries}%
    %\renewcommand{\chaptitlefont}{\Huge\sffamily\bfseries}%
    %\renewcommand{\printchaptertitle}[1]{%
        %\chaptitlefont\hrule height 0.5pt \vspace{1em}%
        %{##1}\vspace{1em}\hrule height 0.5pt%
        %}%
    %\renewcommand{\printchapternum}{%
        %\chapnumfont\thechapter%
        %}%
%}

%\chapterstyle{mychapterstyle}

%\setsecheadstyle{\Large\sffamily\bfseries}
%\setsubsecheadstyle{\large\sffamily\bfseries}
%\setsubsubsecheadstyle{\normalfont\sffamily\bfseries}
%\setparaheadstyle{\normalfont\sffamily}

%\makeevenhead{headings}{\thepage}{}{\small\slshape\leftmark}
%\makeoddhead{headings}{\small\slshape\rightmark}{}{\thepage}

% *************** Table of contents style ***************
%\settocdepth{subsection}
%
%\setsecnumdepth{subsection}
%\maxsecnumdepth{subsection}
%\settocdepth{subsection}
%\maxtocdepth{subsection}
%
% ********** Commands for epigraphs **********
%\setlength{\epigraphwidth}{0.57\textwidth}
%\setlength{\epigraphrule}{0pt}
%\setlength{\beforeepigraphskip}{1\baselineskip}
%\setlength{\afterepigraphskip}{2\baselineskip}
%
%\newcommand{\epitext}{\sffamily\itshape}
%\newcommand{\epiauthor}{\sffamily\scshape ---~}
%\newcommand{\epititle}{\sffamily\itshape}
%\newcommand{\epidate}{\sffamily\scshape}
%\newcommand{\episkip}{\medskip}
%
%\newcommand{\myepigraph}[4]{%
%	\epigraph{\epitext #1\episkip}{\epiauthor #2\\\epititle #3 \epidate(#4)}\noindent}

% *************** Other ***************
\renewcommand{\thefootnote}{\fnsymbol{footnote}}

% *************** End of document style definition ***************

\usepackage[square]{natbib}
\bibpunct{[}{]}{,}{a}{,}{,}
\renewcommand{\cite}{\citep}
%\newlength{\bibhang}
\setlength{\bibhang}{2em}

%\usepackage{harvard}
%\harvardparenthesis{square}

% \thebibliography environment depends on whether or not chapters can exist.
%\@ifundefined{chapter}{\def\thebibliography#1{\section*{References\@mkboth
  %{REFERENCES}{REFERENCES}}\list
  %{\relax}{\setlength{\labelsep}{0em}
	%\setlength{\itemindent}{-\bibhang}
	%\setlength{\leftmargin}{\bibhang}}
    %\def\newblock{\hskip .11em plus .33em minus .07em}
    %\sloppy\clubpenalty4000\widowpenalty4000
    %\sfcode`\.=1000\relax}}%
%{\def\thebibliography#1{\chapter*{Bibliography\@mkboth
  %{BIBLIOGRAPHY}{BIBLIOGRAPHY}}\list
  %{\relax}{\setlength{\labelsep}{0em}
	%\setlength{\itemindent}{-\bibhang}
	%\setlength{\leftmargin}{\bibhang}}
    %\def\newblock{\hskip .11em plus .33em minus .07em}
    %\sloppy\clubpenalty4000\widowpenalty4000
    %\sfcode`\.=1000\relax}}

% a hack to change bibiliography -> REFERENCES
%\makeatletter
%\def\thebibliography#1{\chapter*{References\@mkboth
	%{REFERENCES}{REFERENCES}}\list
	%{[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}\leftmargin\labelwidth
		%\advance\leftmargin\labelsep
		%\usecounter{enumi}}
	%\def\newblock{\hskip .11em plus .33em minus .07em}
	%\sloppy\clubpenalty4000\widowpenalty4000
	%\sfcode`\.=1000\relax}
%\makeatother

\makeatletter
\def\thebibliography#1{\chapter*{References\@mkboth
	{\textsc{References}}{}}\list
	{\relax}{\setlength{\labelsep}{0em}
	\setlength{\itemindent}{-\bibhang}
	\setlength{\leftmargin}{\bibhang}}
    \def\newblock{\hskip .11em plus .33em minus .07em}
    \sloppy\clubpenalty4000\widowpenalty4000
    \sfcode`\.=1000\relax}
\makeatother

\usepackage{fancyhdr}
\pagestyle{fancy}
%\lhead{} % empty
%\chead{Hello, world!}
%\rhead{Page \thepage} % page number
%\lfoot{}
%\cfoot{\textbf{Hello!}}
%\rfoot{}

%\renewcommand{\chaptermark}[1]{\markboth{\thechapter. \ \chaptername.\ #1}{}}
%\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\chaptermark}[1]{\markboth{\textsc{#1}}{}}
%\renewcommand{\sectionmark}[1]{\markright{\thesection.\ \textsc{#1}}}
\renewcommand{\sectionmark}[1]{\markright{\textsc{#1}}}


\usepackage{setspace}
%\singlespace
\onehalfspace
%\doublespace
